import request from "@/utils/request";
// GET /admin/acl/index/menu
interface loginParamsModel  {
  username:string,
  password:string
}
//定义返回的token值
interface tokenModel {
  token:string
}
interface logoutModel {
'':''
}
//定义用户的信息
export interface userInfoModel {
  avatar:string,
  buttons:string[],
  name:string,
  roles:string[],
  routes:string[]
}
export default {
  // POST /admin/acl/index/login 登录请求
  login :(loginParams:loginParamsModel)=>{
    return request.post<any,tokenModel>('/admin/acl/index/login',loginParams);

  },
  // POST /admin/acl/index/logout 退出登录请求
  logout:()=>{
    return request.post<any,logoutModel>('/admin/acl/index/logout');
  },
  // GET /admin/acl/index/info 获取用户信息的请求
  info:()=>{
    return request.get<any,userInfoModel>('/admin/acl/index/info');
  },
// GET /admin/acl/index/menu
  menu:()=>{
    return request.get<any,any>('/admin/acl/index/menu');
  }
}
